package com.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * AccpUser entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ACCP_USER", schema = "ACCP", uniqueConstraints = @UniqueConstraint(columnNames = "UNAME"))
@SequenceGenerator(name="seq",sequenceName="SEQ_ACCPUSER")
public class AccpUser implements java.io.Serializable {

	// Fields

	private Integer id;
	private String uname;
	private String upwd;
	private Integer status;
	private Set<AccpFiles> accpFileses = new HashSet<AccpFiles>(0);
	private Set<AccpInfo> accpInfos = new HashSet<AccpInfo>(0);
	private Set<AccpTeacher> accpTeachers = new HashSet<AccpTeacher>(0);
	private Set<AccpStudent> accpStudents = new HashSet<AccpStudent>(0);

	// Constructors

	/** default constructor */
	public AccpUser() {
	}

	/** minimal constructor */
	public AccpUser(Integer id) {
		this.id = id;
	}

	/** full constructor */
	public AccpUser(Integer id, String uname, String upwd, Integer status,
			Set<AccpFiles> accpFileses, Set<AccpInfo> accpInfos,
			Set<AccpTeacher> accpTeachers, Set<AccpStudent> accpStudents) {
		this.id = id;
		this.uname = uname;
		this.upwd = upwd;
		this.status = status;
		this.accpFileses = accpFileses;
		this.accpInfos = accpInfos;
		this.accpTeachers = accpTeachers;
		this.accpStudents = accpStudents;
	}

	// Property accessors
	@Id
	@Column(name = "ID", unique = true, nullable = false, precision = 8, scale = 0)
	@GeneratedValue(generator="seq")
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "UNAME", unique = true)
	public String getUname() {
		return this.uname;
	}

	public void setUname(String uname) {
		this.uname = uname;
	}

	@Column(name = "UPWD")
	public String getUpwd() {
		return this.upwd;
	}

	public void setUpwd(String upwd) {
		this.upwd = upwd;
	}

	@Column(name = "STATUS", precision = 8, scale = 0)
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpUser")
	public Set<AccpFiles> getAccpFileses() {
		return this.accpFileses;
	}

	public void setAccpFileses(Set<AccpFiles> accpFileses) {
		this.accpFileses = accpFileses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpUser")
	public Set<AccpInfo> getAccpInfos() {
		return this.accpInfos;
	}

	public void setAccpInfos(Set<AccpInfo> accpInfos) {
		this.accpInfos = accpInfos;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpUser")
	public Set<AccpTeacher> getAccpTeachers() {
		return this.accpTeachers;
	}

	public void setAccpTeachers(Set<AccpTeacher> accpTeachers) {
		this.accpTeachers = accpTeachers;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpUser")
	public Set<AccpStudent> getAccpStudents() {
		return this.accpStudents;
	}

	public void setAccpStudents(Set<AccpStudent> accpStudents) {
		this.accpStudents = accpStudents;
	}

}